package 力扣日常刷题.木22一月.第17天0129;

/**
 * @author 帅小伙
 * @date 2022/1/29
 * @description
 */
public class Demo33简单数组重新排列数组 {



    public int[] shuffle(int[] nums, int n) {
        int[] ans = new int[n];
        for (int i = 0 , j = n; i < n; i++,j++) {
            ans[i*2] = nums[i];
            ans[i*2+1] = nums[j];
        }
        return ans;
    }
}
